﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using PHMEE.Admin.Controllers;
using PHMEE.Admin.Videos;
using PHMEE.Videos;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PHMEE.Controllers.Videos
{
    /// <summary>
    /// 操作视频
    /// </summary>
    [Route("phmeeadmin/api/videoctrls")]
    public class VideoCtrlsController : PHMEEAdminController
    {
        private readonly IVideoCtlsAppService _videoCtlsAppService;

        /// <summary>
        /// 
        /// </summary>
        /// <param name="videoCtlsAppService"></param>
        public VideoCtrlsController(IVideoCtlsAppService videoCtlsAppService)
        {
            _videoCtlsAppService = videoCtlsAppService;
        }

        /// <summary>
        /// 控制视频播放
        /// </summary>
        /// <param name="videoAction"></param>
        /// <param name="localchn"></param>
        /// <returns></returns>
        [HttpGet]
        [Route("OperationVideo")]
        [AllowAnonymous]
        public async Task<VideoResControlDto> OperationVideo([Required] VideoActionEnum videoAction, [Required] int localchn)
        {
            return await _videoCtlsAppService.SetVideoStatus(videoAction, localchn);
        }
    }
}
